<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    6-giu-2012
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
     
    //]]>
</script>

<div id="content">
        <div id="summary" class="activities">
	<div class="head activities">
            <h2>Scheda Attivit&agrave;</h2>
	</div>
	<div class="body">
            <table cellspacing="0" class="table">
                <tbody>
                    <tr>
                        <th>Nome:</th>
                        <td>
                            <strong>
                            <?php echo $this->data['activity_title']?>
                            </strong>
                        </td>
                    </tr>
                    <tr>
                        <th>Data:</th>
                        <td>
                            
                            <?php
                                switch( true ):
                                    case $this->data['activity_end_date'] == null:
                                        echo '<strong>'. $this->data['activity_start_date_d'] ?> <?php echo $this->months[sprintf( '%01d', $this->data['activity_start_date_m'] )] ?> <?php echo $this->data['activity_start_date_y'] .'</strong>';
                                        if( $this->data['activity_start_time'] != null ):
                                            echo ' alle '. $this->data['activity_start_time'];
                                        endif;
                                        break;
                                    
                                    case $this->data['activity_end_date'] != null:
                                        echo  'Entro il <strong>'. $this->data['activity_end_date_d'] ?> <?php echo $this->months[sprintf( '%01d', $this->data['activity_end_date_m'] )] ?> <?php echo $this->data['activity_end_date_y'] .'</strong>';
                                        if( $this->data['activity_end_time'] != null ):
                                            echo ' alle <strong>'. $this->data['activity_end_time_ita'] .'</strong>';
                                        endif;
                                        break;
                                    
//                                    case $this->data['activity_start_date'] != null AND $this->data['activity_end_date'] != null:
//                                        echo 'Dal '. $this->data['activity_start_date_d'] ?> <?php echo $this->months[sprintf( '%01d', $this->data['activity_start_date_m'] )] ?> <?php echo $this->data['activity_start_date_y'];
//                                        echo ' al '. $this->data['activity_end_date_d'] ?> <?php echo $this->months[sprintf( '%01d', $this->data['activity_end_date_m'] )] ?> <?php echo $this->data['activity_end_date_y'];
//                                        break;
                                    default:
                                        break;
                                endswitch;
                            ?>
                            
                        </td>
                    </tr>
                    <tr>
                        <th>Assegnato a:</th>
                        <td>
                            <strong>
                            <?php echo $this->data['user_firstname']?> <?php echo $this->data['user_lastname']?>
                            </strong>
                        </td>
                    </tr>
                    <tr class="break">
                        <td colspan="2">&nbsp;</td>
                    </tr>                            
                    <tr>
                        <th>Note:</th>
                        <td><?php echo $this->data['activity_description']?></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <form>
        <ul>
	    <li id="errorLi" style="<?php echo $this->errorMsg ? '' : 'display:none' ?>">
		<h3 id="errorMsgLbl">Si &egrave; verificato un problema durante l'invio del modulo.</h3>
		<p id="errorMsg">
		Di seguito trovi evidenziati gli errori riscontrati. <?php var_dump( $this->errorMsg ) ?>
		</p>
	    </li>
        </ul>
    </form>
    <div class="warning">
        <form id="form-live" class="fab" method="post" action="/admin/attivita/chiudi/id/<?php echo $this->activity_id ?>">
        <h2>Attenzione!</h2>
        <div class="message"><br/>Sei sicuro di voler chiudere quest'attivit&agrave;?</div>
        <div class="break">&nbsp;</div>
            <ul>
                <li class="addnew center">
                    <button id="conferma" name="conferma" value="conferma" class="button positive">
                        <img src="/images/admin/tick.png" alt="" />S&iacute; certo!
                    </button>
                    <button id="annulla" name="annulla" value="annulla" class="button negative">
                        <img src="/images/admin/cross.png" alt="" />No. C'ho ripensato...
                    </button>
                </li>
            </ul>
        </form>
    </div>
</div>
